package org.example.panel.userpanel;
import javax.swing.*;
import java.awt.event.*;
import org.example.frame.*;

/**
 * @author lenovo
 */

public class ExitFramePanel extends JPanel {
    public ExitFramePanel(JFrame frame){
        //组件准备
        JButton exitFrame = new JButton("退出登录");
        //注册监视器
        exitFrame.addActionListener((ActionEvent e)->{
            JOptionPane.showMessageDialog(null,
                    "退出登录成功", null , JOptionPane.WARNING_MESSAGE);
            new FirstFrame();
            frame.dispose();
        });
        //添加组件
        add(exitFrame);
    }
}
